home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
os2
/
hapb2_d1.zip
/
HAOS2D.Z
/
DELPHI.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-07-02
|
4KB
|
109 lines
/* This program delphi.cmd, created by Hilgraeve and assigned to the */
/* Delphi phonebook entry runs an automated logon script for connecting */
/* to the Delphi service */
/* $Revision: 1.1 $ */
/* $Date: */
/* A REXX script MUST begin with a commented line */
/* Text within slashes and asterisks (like this line) are comments. */
/* Parse the command line for arguments passed to this program */
PARSE ARG pipename
/* Register external functions with REXX */
CALL RxFuncAdd 'haLoadFuncs', 'HAP_AUTO', 'RxhaLoadFuncs'
CALL haLoadFuncs
/* Establish a link between this script program and HyperACCESS */
scripthandle = 0
scripthandle = haInitialize(1, pipename)
DROP pipename
/* Process only if link with HyperACCESS was successful */
IF scripthandle <> 0 THEN
DO
/* Initialize useful variables */
cr = '0D'x
lf = '0A'x
nul = '00'x
returnvalue = 0
/* Type a '@' then <enter> */
IF returnvalue >= 0 THEN
returnvalue = haTypeText(scripthandle, 0, '@')
/* Pause */
IF returnvalue >= 0 THEN
returnvalue = haSleep(ScriptHandle, 1000L)
/* Type a <enter> */
IF returnvalue >= 0 THEN
returnvalue = haTypeText(ScriptHandle, 0, cr)
/* Wait for one of three prompts possible with Tymenet or Telenet */
IF returnvalue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 3, "ERMINAL="nul"r name: "nul"identifier"nul, 300, 32000)
/* If Tymenet do this block */
IF returnvalue == 0 THEN
DO
/* Type an <enter> */
ReturnValue = haTypeText(ScriptHandle, 0, cr)
/* Wait for a prompt */
IF returnvalue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "@", 300, 32000)
/* Type text to request Delphi */
IF returnvalue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, "c delphi"cr)
END
/* If Telenet do this block */
else
DO
/* Type an 'o' */
ReturnValue = haTypeText(ScriptHandle, 0, "o")
/* Wait for a prompt */
IF returnvalue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "log in: ", 300, 32000)
/* Type text requesting Delphi */
IF returnvalue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, "delphi"cr)
END
/* Wait for a prompt */
IF returnvalue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "ername: ", 300, 32000)
/* Get User Name from Runtime Values dialog box */
IF returnvalue >= 0 THEN
ReturnValue = haGetRuntimeValue(ScriptHandle, 1, 1, 128, 'UName')
/* Type the value */
IF returnvalue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, UName||cr)
/* Wait for a prompt */
IF returnvalue >= 0 THEN
ReturnValue = haWaitForPrompt(ScriptHandle, 1, "ssword: ", 300, 32000)
/* Get Password value from Runtime Values dialog box */
IF returnvalue >= 0 THEN
ReturnValue = haGetRuntimeValue(ScriptHandle, 3, 1, 128, 'PWord')
/* Type the value */
IF returnvalue >= 0 THEN
ReturnValue = haTypeText(ScriptHandle, 0, PWord||cr)
/* Terminate link between HyperACCESS and script program */
CALL haTerminate scripthandle
END
DROP scripthandle
CALL haDropFuncs